package com.shyroke.service.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shyroke.entity.PiZhu;
import com.shyroke.mapper.PiZhuMapper;
import com.shyroke.service.PiZhuServiceI;

@Service
public class PiZhuServiceImpl implements PiZhuServiceI {

	@Autowired
	private PiZhuMapper pizhuMapper;
	
	@Override
	public void insert(PiZhu pizhu) {
		
		pizhuMapper.insert(pizhu);
	}

	@Override
	public void deleteByPID(Integer xiaoshuoid, Integer userId, Integer pId) {
		
		pizhuMapper.deleteByPID(xiaoshuoid,userId,pId);
	}

	@Override
	public List<PiZhu> selectByUserIdAndXiaoshuoID(Integer userId, Integer xiaoshuoid) {
		
		return pizhuMapper.selectByUserIdAndXiaoshuoID(userId,xiaoshuoid);
	}

	@Override
	public PiZhu selectByPid(Integer userId, Integer pId, Integer xiaoshuoId) {
		
		return pizhuMapper.selectByPid(userId,pId,xiaoshuoId);
	}

}
